package com.irdstudio.basic.sequence.service.impl;

import com.irdstudio.basic.sequence.service.facade.SeqService;
import com.irdstudio.basic.sequence.service.impl.support.snowflake.UidGenerator;

/**
 * @description:适配基于Snowflake算法的分布式唯一流水号生成策略, 只有一个序号空间
 * 				长度固定为63bit，有序
 * @date:2019年2月13日 下午5:33:15
 * @author:hengyh
 */
public class SfUidGeneratorAdapter implements SeqService {
    private UidGenerator delegate;

    public SfUidGeneratorAdapter(UidGenerator delegate) {
        this.delegate = delegate;
    }

    @Override
    public String getSequence() {
        return String.valueOf(delegate.getUID());
    }
}
